﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ePioneer/MasterPage.master" AutoEventWireup="true"
    CodeFile="ep_customer.aspx.cs" Inherits="ePioneer_ep_customer" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="posbar dpbar_kefu">
        <div class="topmenu">
            <div class="tmitem tmi_1" style="cursor: pointer;">
            </div>
            <div class="tmitem tmi_2 tmi_on2" style="cursor: pointer;">
            </div>
        </div>
    </div>
    <!--kefu content start-->
    <div class="mbody8_kefu">
        <div class="menubox8">
            <div class="mb_item">
            </div>
            <div class="mb_item">
            </div>
            <div class="mb_item">
            </div>
            <div class="mb_item">
            </div>
        </div>
        <div class="mshow_cnt">
            <div class="msc_show" style="display: block;">
                <div>
                    <img src="images/dp_kefu_ht_r2_c2.jpg" width="648" height="58" /><img src="images/dp_kefu_ht_r3_c2.jpg"
                        alt="" width="648" height="58" /><img src="images/dp_kefu_ht_r4_c2.jpg" alt="" width="648"
                            height="58" /></div>
                <div class="formbox8">
                    <div style="width: 310px; margin: 0px auto;">
                        <div class="inpbox">
                            用户名：<input name="loginUser" class="inp" id="userId" value="" style="width: 230px;" /></div>
                        <div class="inpbox">
                            密&nbsp;&nbsp;码：<input name="loginUser" type="password" class="inp" id="password"
                                value="" style="width: 230px; margin-left: 3px;" /></div>
                        <div class="inpbox">
                            验证码：<input name="loginUser" class="inp" id="checkcode" value="" style="width: 160px;" />
                            <img src="RegImg.aspx" class="checkcode" style="vertical-align: middle;" id="regimgcode" /></div>
                        <div class="inpbox" style="padding-left: 50px;">
                            <input type="button" class="button1" name="" value="" id="btnLogin" /><input type="button"
                                class="button2" name="" value="" id="btnReset" /><input type="button" class="button3"
                                    name="" value="" id="btnForget" />
                        </div>
                    </div>
                </div>
            </div>
            <div class="msc_show">
                <div class="formbox9">
                    <div style="width: 380px; margin: 150px auto 0 auto;">
                        <div class="inpbox">
                            用户名：<input name="" class="inp" id="" value="" style="width: 210px;" /></div>
                        <div class="inpbox">
                            验证码：
                            <input name="" class="inp" id="" value="" style="width: 140px;" />
                            <img src="images/checkcode.gif" class="checkcode" /></div>
                        <div class="inpbox" style="padding-left: 50px;">
                            <input type="button" class="button1" name="" value="" /><input type="button" class="button2"
                                name="" value="" />
                        </div>
                    </div>
                </div>
            </div>
            <div class="msc_show">
                <div>
                    <img src="images/dp_kefu_ht_004.jpg" /></div>
                <div class="formbox10">
                    <div style="width: 380px; margin: 0px auto 0 auto;">
                        <div class="inpbox">
                            用户名：<input name="" class="inp" id="" value="" style="width: 210px;" /></div>
                        <div class="inpbox">
                            验证码：
                            <input name="" class="inp" id="" value="" style="width: 140px;" />
                            <img src="images/checkcode.gif" class="checkcode" /></div>
                        <div class="inpbox" style="padding-left: 50px;">
                            <input type="button" class="button1" name="" value="" /><input type="button" class="button2"
                                name="" value="" />
                        </div>
                    </div>
                </div>
            </div>
            <div class="msc_show">
                <div>
                    <img src="images/dp_kefu_ht_006.jpg" /></div>
                <div class="formbox11">
                    <div style="width: 380px; margin: 0px auto 0 auto;">
                        <div class="inpbox">
                            用户名：<asp:Label ID="LabelUserId" runat="server" Text=""></asp:Label></div>
                        <div class="inpbox">
                            <asp:Label ID="LabelDay" runat="server" Text=""></asp:Label>
                        </div>
                        <div class="inpbox" style="padding: 0 0 0 55px;">
                            <asp:Label ID="LabelDate" runat="server" Text=""></asp:Label></div>
                    </div>
                </div>
            </div>
            <div class="msc_show">
                <div class="formbox12">
                    <div style="text-align: center; height: 80px;">
                        <br />
                        <img src="images/dp_kefu_ht_011.jpg" width="455" height="35" />
                    </div>
                    <ul class="infobox12">
                        <li class="litem01">
                            <div class="licnt">
                                <h2>
                                    用密保手机找回密码</h2>
                                填写密保手机用于密码丢失时，用手机找回密码</div>
                        </li>
                        <li class="litem02">
                            <div class="licnt">
                                <h2>
                                    验证密保邮箱</h2>
                                填写密保邮箱，用户丢失密码后可通过邮箱找回密码</div>
                        </li>
                        <li class="litem03">
                            <div class="licnt">
                                <h2>
                                    密码提示问题</h2>
                                密保提示问题，密码丢失后可通过提示问题找回密码</div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <input type="hidden" runat="server" id="hidusertype" />
    <input type="hidden" runat="server" id="hidCode" />
    <script type="text/javascript" language="javascript">
        $menugp = $(".mbody8_kefu .menubox8 .mb_item");
        $mscontentgp = $(".mbody8_kefu .mshow_cnt .msc_show");
        $menugp.click(function () {
            for (a = 0; a < 4; a++) {
                $menugp.removeClass("itmon" + a);
            }
            $mgpindex = $menugp.index($(this)[0]);
            var countm = $mgpindex;
            switch (countm) {
                case 0:
                    if ($("#hidusertype").val() != "0") {
                        alert("抱歉，此功能仅支持正式版，体验期内不可使用。");
                        return false;
                    }
                    break;
                case 1:
                case 3:
                    alert("抱歉，此功能仅支持正式版，体验期内不可使用。");
                    return false;
                    break;
                case 2:
                    if ($("#LabelUserId").text() == "" || $("#LabelUserId").text() == null) {
                        alert("请先登录后再点击查看");
                        return false;
                    }
                    break;
                default:
                    break;
            }
            $(this).addClass("itmon" + $mgpindex);
            $mscontentgp.hide();
            $mscontentgp.eq($mgpindex + 1).show();
        });

        $(document).ready(function () {
            if ($("#LabelUserId").val() != null && $("#LabelUserId").val() != "") {
                $menugp = $(".mbody8_kefu .menubox8 .mb_item");
                $mscontentgp = $(".mbody8_kefu .mshow_cnt .msc_show");
                for (var a = 0; a < 4; a++) {
                    $menugp.removeClass("itmon" + a);
                }
                $menugp.eq(2).addClass("itmon2");
                $mscontentgp.hide();
                $mscontentgp.eq(3).show();
            }
            $(".topmenu .tmi_1:first").click(function () {
                alert("抱歉，暂无最新会场信息。");
            });

            $("#btnReset").click(function () {
                $("input[name=loginUser]").val("");
            });

            $("#btnForget").click(function () {
                var userid = $("#userId").val();
                if ($.trim(userid) == "") {
                    alert("用户名不能为空");
                    $("#userId").focus();
                    return false;
                }
                else {
                    var email = new RegExp("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
                    var mobile = new RegExp("^0{0,1}(13[0-9]|15[0-9]|180|147|182|18[4-9])[0-9]{8}$");
                    if (!email.test(userid) && !mobile.test(userid)) {
                        alert("用户名不正确，请重新输入。");
                        return false;
                    }
                }
                alert("密码已发送到您的手机，请查看。");
            });


            $("#btnLogin").click(function () {
                var userid = $("#userId").val();
                var password = $("#password").val();
                var checkcode = $("#checkcode").val();
                if ($.trim(userid) == "") {
                    alert("用户名不能为空");
                    $("#userId").focus();
                    return false;
                }
                else {
                    var email = new RegExp("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
                    var mobile = new RegExp("^0{0,1}(13[0-9]|15[0-9]|180|147|182|18[4-9])[0-9]{8}$");
                    if (!email.test(userid) && !mobile.test(userid)) {
                        alert("用户名不正确，请重新输入。");
                        return false;
                    }
                }
                if ($.trim(password) == "") {
                    alert("密码不能为空");
                    return false;
                }
                if ($.trim(checkcode) == "") {
                    alert("验证码不能为空");
                    return false;
                }

                $.ajax({
                    type: "POST",
                    url: "CheckCode.aspx",
                    dataType: "html",
                    data: { checkcode: checkcode },
                    success: function (data) {
                        if (data == 1) {
                            $.ajax({
                                type: "POST",
                                url: "../UserInfoCookies.ashx",
                                dataType: "json",
                                data: { userid: userid, password: password, checkcode: checkcode },
                                success: function (result) {
                                    if (result[0] == 1) {
                                        alert("登录成功！");
                                        $menugp = $(".mbody8_kefu .menubox8 .mb_item");
                                        $mscontentgp = $(".mbody8_kefu .mshow_cnt .msc_show");
                                        for (var a = 0; a < 4; a++) {
                                            $menugp.removeClass("itmon" + a);
                                        }
                                        $menugp.eq(2).addClass("itmon2");
                                        $mscontentgp.hide();
                                        $mscontentgp.eq(3).show();
                                        $("#ContentPlaceHolder1_LabelUserId").text(result[2]);
                                        $("#ContentPlaceHolder1_hidusertype").val(result[1]);
                                        $("#ContentPlaceHolder1_LabelDay").text(result[3]);
                                        if (result[1] == "2")
                                            $("#ContentPlaceHolder1_LabelDate").text(result[4]);
                                    }
                                    else {
                                        alert("登录失败！");
                                    }
                                }
                            });
                        }
                        else {
                            alert("验证码错误");
                        }
                    }
                });
                return false;
            });
        });
    </script>
</asp:Content>
